#header{
<!-- webuploader css -->
<link rel="stylesheet" href="/css_js/webuploader/webuploader.css" type="text/css" />
<link rel="stylesheet" href="/css_js/3dRollPic/demo.css">
<link rel="stylesheet" href="/css_js/checkbox/style.css" />
<script src="/css_js/checkbox/main.js"></script>
<!--color-->
<script src="/css_js/Colorpicker/spectrum.js"></script>
<script src="/css_js/Colorpicker/docs.js"></script>
<link rel="stylesheet" href="../../../../css_js/Colorpicker/spectrum.css" /> }# #body{

<div class="row">
	<div class="col-sm-12">
		<div class="ibox float-e-margins">
			<div class="ibox-title">
				<h5></h5>
			</div>
			<div class="ibox-content">
				<form method="post" action="<?php echo SplitUrl(" homepage/column/layoutupdate ") ?>">
					<input name="id" value="<?php echo isset($output[0])?$output[0]:'0' ?>" hidden/>
					<input name="data[img1]" id="img1" value="!!isset($output[0])?$output['img1']:''!!" hidden/>

					<div class="form-horizontal m-t">
						<div class="form-group">
							<label class="col-sm-1 control-label">主题：</label>
							<div class="col-sm-2">
								<input class="form-control" name="data[title]" size="10" type="text" value="<?php echo isset($output[0])?$output['title']:'' ?>" />
								<span class="field-validation-error" veri-for=""></span>
							</div>
						</div>

						<div class="form-horizontal m-t">
							<div class="form-group">
								<label class="col-sm-1 control-label">关键字：</label>
								<div class="col-sm-10">
									<input class="form-control" name="data[keywords]" size="10" type="text" value="<?php echo isset($output[0])?$output['keywords']:'' ?>" />
									<span class="field-validation-error" veri-for=""></span>
								</div>
							</div>

							<div class="form-horizontal m-t">
								<div class="form-group">
									<label class="col-sm-1 control-label">描述：</label>
									<div class="col-sm-10">
										<input class="form-control" name="data[description]" size="10" type="text" value="<?php echo isset($output[0])?$output['description']:'' ?>" />
										<span class="field-validation-error" veri-for=""></span>
									</div>
								</div>

								<div class="form-group">
									<label class="col-sm-1 control-label">落款：</label>
									<div class="col-sm-5">
										<input class="form-control" name="data[Inscribe]" size="10" type="text" value="<?php echo isset($output[0])?$output['Inscribe']:'' ?>" /> <span class="field-validation-error" veri-for=""></span>
									</div>
								</div>

								<div class="form-group">
									<label class="col-sm-1 control-label">音乐自动播放：</label>
									<div class="col-sm-2">
										<div class="btn_fath clearfix !{if $output['musicPlay']==0}off!{else}on!{/if}" onclick="toogle(this)">
											<div class="move" data-state="!{if $output['musicPlay']==0}off!{else}on!{/if}"></div>
											<!--状态参数不要有空格-->
											<div class="btnSwitch btn1">ON</div>
											<div class="btnSwitch btn2 ">OFF</div>
											<input name="data[musicPlay]" hidden value="!!$output['musicPlay']!!" />
										</div>
									</div>
								</div>

								<div class="form-group">
									<label class="col-sm-1 control-label">主体文字颜色：</label>
									<div class="col-sm-4">
										<input id="Df_color" name='data[color]' value="!!isset($output[0])?$output['color']:''!!" />
										<script>
										var	initColor='!!isset($output[0])?$output['color']:''!!'
										</script>

									</div>
								</div>

								<div class="form-group">
									<!--加载多张背景图会拖网速，所以只用一张-->
									<label class="col-sm-1 control-label">背景图片：</label>1920*1280
									<div class="col-sm-4">
										<div class="upload">
											<div class="uploadPreview1">
												<?php echo isset($output[0])?"<img src='{$output['img1']}' />":'暂无图片' ?>
											</div>
											<div class="left">
												<div class="uploadProgressBar"></div>
												<div class="uploadBut1" id="uploadBut1">选择图片</div>
											</div>
											<div class="clear"></div>
										</div>
									</div>
								</div>

								<div class="form-group">
									<div class="wrapper">
										<ul>
											!{each $img}

											<li>
												<div class="picBox">
													<div class="show">
														<img height="180px" width="180px" src="!`img`">
													</div>
													<div class="hide">
														<h3> 
<a href="javascript:selePic('!`img`')">使用</a>
</h3>
													</div>
												</div>
											</li>
											!{/each}

										</ul>
									</div>
								</div>

								<div class="form-group">
									<div class="col-sm-2 col-sm-offset-1">
										<button class="btn btn-primary" onclick="return submit_form()">保存</button>
									</div>
								</div>
							</div>
				</form>
				</div>
				</div>
			</div>
		</div>

		}# #footer{

		<!-- webuploader js -->
		<script src="/css_js/webuploader/webuploader.min.js"></script>
		<script type="text/javascript">
			//验证输入
			function verify() {
				if($("input[name='data[title]']").val() == "") {
					$("[name='data[title]']").next().html('请输入标题')
					return false;
				}
				if($("#html").val() == "<p><br></p>") {
					$("[veri-for='Body']").html('请输入内容')
					return false;
				}
				return true;
			}

			function submit_form() {
				$("#html").val($("#Body").html());
				return verify();
			}

			//上传图片
			function uploadImg(button, div, input) {

				var uploader = WebUploader.create({
					// 自动上传
					auto: true,
					// 选择文件的按钮
					pick: button,
					// swf文件路径
					swf: '/content/www/lib/webuploader/Uploader.swf',
					// 文件接收服务端。
					server: '<?php echo SplitUrl("homepage/column/layoutPicUp/file") ?>',
					method: 'POST'
				});
				uploader.on('uploadProgress', function(file, percentage) {
					$(div).html("上传中...");
				});

				uploader.on('uploadSuccess', function(file, response) {
					//文件效验
					if(response == "-1") //简单的图片上传需要验证
						$(div).html('文件出错');
					else if(response == "-2")
						$(div).html('类型不允许');
					else if(response == "-3")
						$(div).html('文件太大');
					else {
						//获取原始数据
						var data = response._raw;
						$(div).html("<img src=\"" + data + "\"  />");
						$(input).val(data);
					}
				});

				uploader.on('uploadError', function(file) {
					$(div).html("上传失败");
				});

			}
			//上传图片
			$(function() {
				uploadImg('.uploadBut1', ".uploadPreview1", "#img1");
			})

			function selePic(src) {

				$('#img1').val(src)
				$('.uploadPreview1').children().attr('src', src);

			}
		</script>

		<script src="/css_js/3dRollPic/demo.js"></script>

		}#